home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / source.exe / POSIX / MAKE / DF_MI.C < prev    next >
C/C++ Source or Header  |  1992-09-07  |  582b  |  35 lines

  1. #include <stdio.h>
  2.  
  3. #define MAX_INCLUDE 10
  4. int include_cnt;
  5. char include_lines [MAX_INCLUDE][84];
  6.  
  7. df_mi(register char *line)
  8. {
  9.     char
  10.         buf [84];
  11.     register char
  12.         *c;
  13.  
  14.     strcpy (buf, line);
  15.     c = strtok (buf, " \r\t\n");
  16.     for ( ; c; c = strtok (0, " \r\t\n") )
  17.         if(!memcmp(c, "-I", 2) && include_cnt < MAX_INCLUDE)
  18.             strcpy(include_lines[include_cnt++], c);
  19. }
  20.  
  21. dump_includes() {
  22.     FILE 
  23.         *fp;
  24.     register 
  25.         i;
  26.  
  27.     unlink ("/tmp/cc.inc");
  28.     fp = fopen("/tmp/cc.inc", "w");
  29.  
  30.     for(i = 0; i < include_cnt; i++)
  31.         fprintf(fp, "%s\n", include_lines[i]);
  32. }
  33.  
  34.  
  35.